#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>

#include "about.h"
#include "rename.h"

namespace Ui
{
    class MainWindowClass;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindowClass *ui;
    QString dir;
    QStringList filesOrig;
    QStringList filesNew;
    Rename *renameThreads;

    QSettings *settings;
    QFlags<QDir::Filter> _dirFilter;

    int _threads;
    int _activeThreads;
    int _threadErrors;


    void loadDirectory(); //loads dir

private slots:
    void on_actionReload_activated();
    void on_chkSystemFiles_clicked();
    void on_chkHiddenFiles_clicked();
    void on_chkThreads_clicked();
    void on_actionOptions_activated();
    void on_btnReplaceAll_clicked();
    void on_btnFindNext_clicked();
    void on_btnReplace_clicked();
    void on_btnHide_clicked();
    void on_action_Find_and_Replace_activated();
    void on_actionE_xit_activated();
    void on_action_About_activated();
    void on_action_RRename_activated();
    void on_action_Open_Directory_activated();

    void resetFind();
    bool findNext();
    bool replace();
    void toggleFind(bool visible);
    void toggleOptions(bool visible);
    void toggleThreads(bool toggle);
    void toggleHidden(bool toggle);
    void toggleSystem(bool toggle);

public slots:
    void renameThreadFinished(int numErrors);
};

#endif // MAINWINDOW_H
